package main

import (
	"fmt"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	//	创建一个APP
	a := app.New()
	// 给APP创建个一个窗口，NewWindow 函数需要传入一个窗口的命名
	w := a.NewWindow("Achou")

	form := widget.NewForm(
		widget.NewFormItem("UserName", widget.NewEntry()),
		widget.NewFormItem("Passord", widget.NewPasswordEntry()),
		)

	form.OnSubmit = func() {
		fmt.Println("Onsubmit")
	}

	form.OnCancel = func() {
		fmt.Println("Oncancel")
	}

	w.SetContent(form)
	//w.Resize(fyne.NewSize(240, 360))
	// 将窗口显示处理
	w.ShowAndRun()
}
